home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Dogs / Multimedia Dogs v2.0.iso / mac / Extras / MMDogs 2.0 with Desktop / MMDOGS2.DXR / 00291_MIAW List handlers.ls < prev    next >
Encoding:
Text File  |  1995-10-09  |  1.7 KB  |  63 lines

  1. global gpSelectionWindow, gpVideoWindow
  2.  
  3. on openSelectionMIAW theList, theTitle, theCallback
  4.   set width to 294
  5.   set height to 290
  6.   if objectp(gpSelectionWindow) then
  7.     forget(gpSelectionWindow)
  8.   end if
  9.   set gpSelectionWindow to window "MIAW.DIR"
  10.   set dx to the stageLeft + ((the stageRight - the stageLeft - width) / 2)
  11.   set dy to the stageTop + ((the stageBottom - the stageTop - height) / 2)
  12.   set myRect to rect(dx, dy, dx + width, dy + height)
  13.   set the rect of gpSelectionWindow to myRect
  14.   set the title of gpSelectionWindow to EMPTY
  15.   set the windowType of gpSelectionWindow to 5
  16.   open(gpSelectionWindow)
  17.   tell gpSelectionWindow
  18.     doSelection(theList, theTitle, theCallback)
  19.   end tell
  20. end
  21.  
  22. on closeSelectionMIAW
  23.   if objectp(gpSelectionWindow) then
  24.     close(gpSelectionWindow)
  25.     updateStage()
  26.     forget(gpSelectionWindow)
  27.   end if
  28. end
  29.  
  30. on openVideoMIAW theFilename, theTitle
  31.   set width to 286
  32.   set height to 282
  33.   if objectp(gpVideoWindow) then
  34.     forget(gpVideoWindow)
  35.   end if
  36.   set gpVideoWindow to window "MIAW.DIR"
  37.   set dx to the stageLeft + ((the stageRight - the stageLeft - width) / 2)
  38.   set dy to the stageTop + ((the stageBottom - the stageTop - height) / 2)
  39.   set myRect to rect(dx, dy, dx + width, dy + height)
  40.   set the rect of gpVideoWindow to myRect
  41.   set the title of gpVideoWindow to EMPTY
  42.   set the windowType of gpVideoWindow to 1
  43.   open(gpVideoWindow)
  44.   tell gpVideoWindow
  45.     doPlayVideo(theFilename, theTitle)
  46.   end tell
  47.   disableRandomSounds()
  48. end
  49.  
  50. on closeVideoMIAW
  51.   if objectp(gpVideoWindow) then
  52.     close(gpVideoWindow)
  53.     updateStage()
  54.     forget(gpVideoWindow)
  55.     enableRandomSounds()
  56.   end if
  57. end
  58.  
  59. on closeAllMIAWs
  60.   closeSelectionMIAW()
  61.   closeVideoMIAW()
  62. end
  63.